package com.freewater.javabase.demo.designpattern.strategy;

import java.math.BigDecimal;

public class DiscountStrategyClient {
    public static void main(String[] args) {
        final BigDecimal total = BigDecimal.valueOf(150);
        final DiscountContext context = new DiscountContext();

        context.setStrategy(new OverDiscountStrategy());
        System.out.println(context.calculatePrice(total));

        context.setStrategy(new UserDiscountStrategy());
        System.out.println(context.calculatePrice(total));

        context.setStrategy(new PrimeDiscountStrategy());
        System.out.println(context.calculatePrice(total));
    }
}
